<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script type="text/javascript" src="/js/jquery-3.5.1.min.js"></script>
    <script>
        function addResumes() {
            const requestData = {'name': $("#name").val(), 'address': $("#address").val(), 'phone': $("#phone").val()}
            $.ajax({
                url: "/resume/add",
                type: "POST",
                data: JSON.stringify(requestData),
                contentType: "application/json; charset=utf-8",
                success: function (data) {
                    if (data.code !== 0) {
                        alert(data.message)
                    }
                    $(location).attr('href', "/index")
                }
            });
        }
    </script>
</head>
<body>
<table  border="1">
    <tr>
        <td align="right">名称</td>
        <td align="left">
            <input type="text" id="name" value=""/>
        </td>
    </tr>
    <tr>
        <td align="right">地址</td>
        <td align="left"><input type="text" id="address" value=""></td>
    </tr>
    <tr>
        <td align="right">手机号</td>
        <td align="left"><input type="text" id="phone" value=""></td>
    </tr>
    <tr aria-colspan="2">
        <td align="center" colspan="2"><input type="button" onclick="addResumes()" value="添加"/></td>
    </tr>
</table>
</body>
</html>
